#ifndef _GPIO_H_
#define _GPIO_H_

struct gpio_reg {
    volatile unsigned int CRL;
    volatile unsigned int CRH;
    volatile unsigned int IDR;
    volatile unsigned int ODR;
    volatile unsigned int BSRR;
    volatile unsigned int BRR;
    volatile unsigned int LCKR;
};

struct afio_reg {
    volatile unsigned int EVCR;
    volatile unsigned int MAPR;
    volatile unsigned int EXTICR[4];
    unsigned int          RESERVED0;
    volatile unsigned int MAPR2;
};

void init_gpio(void);

extern volatile struct gpio_reg *gpioa;
extern volatile struct gpio_reg *gpiob;
extern volatile struct gpio_reg *gpioc;
extern volatile struct gpio_reg *gpiod;
extern volatile struct gpio_reg *gpioe;
extern volatile struct gpio_reg *gpiof;
extern volatile struct gpio_reg *gpiog;
extern volatile struct afio_reg *afio;

#endif
